import requests
# 发送验证码请求
resp_v=requests.get(url='http://127.0.0.1/index.php?m=Home&c=User&a=verify&r=0.8272049348087803')
# 发送post请求，需要 url、请求头、请求体,cookie
resp = requests.post(url='http://127.0.0.1/index.php?m=Home&c=User&a=do_login&t=0.6131949209671165',
                     headers={'Content-Type':'application/x-www-form-urlencoded'},
                     data={
                         'username':'15766212618',
                        'password':'123456',
                         'verify_code':'8888'
                     },
                     cookies=resp_v.cookies)
# 打印响应内容-显示文本的结果
# print(resp.text)
# 打印响应结果，显示json格式的结果
print(resp.json())
# 发送查看我的订单请求，url、请求头、cookie(内部有session-id用于标识用户已经登录)
resp_c=requests.get('http://127.0.0.1/Home/Order/order_list.html',cookies=resp_v.cookies)
# 打印响应结果
print(resp_c.text)